package org.kabeja.dxf.helpers;

import org.kabeja.dxf.DXFConstants;

/**
 * @author shutao
 * @since 2022/4/24 16:28
 */
public class Point {
    protected double x = 0.0D;
    protected double y = 0.0D;
    protected double z = 0.0D;

    public Point() {
    }

    public Point(double var1, double var3) {
        this.x = var1;
        this.y = var3;
    }

    public Point(double var1, double var3, double var5) {
        this.x = var1;
        this.y = var3;
        this.z = var5;
    }

    public double getX() {
        return this.x;
    }

    public void setX(double var1) {
        this.x = var1;
    }

    public double getY() {
        return this.y;
    }

    public void setY(double var1) {
        this.y = var1;
    }

    public double getZ() {
        return this.z;
    }

    public void setZ(double var1) {
        this.z = var1;
    }

    @Override
    public String toString() {
        return super.toString() + "[" + this.x + "," + this.y + "," + this.z + "]";
    }

    @Override
    public boolean equals(Object var1) {
        if (var1 instanceof Point) {
            Point var2 = (Point)var1;
            double var3 = DXFConstants.POINT_CONNECTION_RADIUS;
            if (Math.abs(this.x - var2.getX()) <= var3 && Math.abs(this.y - var2.getY()) <= var3) {
                return Math.abs(this.z - var2.getZ()) <= var3;
            }
        }

        return false;
    }
}
